﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace KS.DataWrapper.Config
{
    public static class WebApiConfig
    {
        public static void RegisterRoute(HttpConfiguration config)
        {
            config.Routes.MapHttpRoute(
                name: "KSDataWrapper",
                routeTemplate: BaseUrl+"/{controller}/{action}/{id}",
               defaults: new { id = RouteParameter.Optional }
            );

            config.Routes.MapHttpRoute(
                name: "KSDataWrapperAuthController",
                routeTemplate: BaseUrl + "/KSAuth",
                defaults: new { controller = "Auth", action = "GetCredentials" }
            );
        }

        public static string BaseUrl
        {
            get
            {
                return "api/KSDW";
            }
        }
    }
}
